package com.dong.ioc.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * description
 *
 * @author Administrator 2021/08/31 14:43
 */
public class AnnotationTest {

    public static void main(String[] args) {
        //ApplicationContext context1 = new ClassPathXmlApplicationContext("classpath:/bean.xml");
        ApplicationContext context = new AnnotationConfigApplicationContext("com.dong.ioc.annotation");

        MyValueConfiguration myValueConfiguration = context.getBean(MyValueConfiguration.class);
        System.out.println(myValueConfiguration);

        MyValue myValue = context.getBean(MyValue.class);
        System.out.println(myValue.getValue());
    }
}
